<?php
	include ("motion.php");
	if(isset($_SESSION['logined']) && $_SESSION['logined'] == "ay"){
		header('Location:admin.php');
	}
	else{
		$_SESSION['state'] = "ad_error";
		header('Location:extra_page.php');
	}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/basic_style.css" media="all" type="text/css">
<link rel="stylesheet" href="css/boxs.css" media="all" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Tulpen+One' rel='stylesheet' type='text/css'>
<script src="js/mycode.js"></script>
<!-- admin -->


<script src="js/modernizr.js"></script>
 <!-- jQuery -->
<script src="./js/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="./js/libs/jquery-1.7.min.js">\x3C/script>')</script>
<!-- FlexSlider -->
<script defer src="./js/jquery.flexslider.js"></script>
<script type="text/javascript">
    $(function(){
      SyntaxHighlighter.all();
    });
    $(window).load(function(){
      $('.flexslider').flexslider({
        animation: "slide",
        start: function(slider){
          $('body').removeClass('loading');
        }
      });
    });
</script>
</head>
<body>
    <div class="wrap">
        <div class="header-bg">
            <div class="login">
            	<?php
					
					if(isset($_SESSION['logined']) && $_SESSION['logined'] == "ay"){
						echo"
							<form action='motion.php' method='post' onSubmit='javascript:return loginform();'>
								<table>
									<td>
										<tr>
											<label style='margin-left:6px; color:orange;'>Hello </label>
										</tr>
										<tr>
											<label>".$_SESSION['uname']."</label>
										</tr>
									</td>
								 </table>
							</form>
						";
					}
					/*else
					{
						$_SESSION['state'] = "ad_error";
						header('Location:motion.php');
					}*/
					print_r($_SESSION);//for testing only
				?>
            </div>
            <div class="clear"></div>
        </div>
        <div class="header">
            <div class="logo">
                <h1><a href="index.php"><img src="images/LOGO.png" width=60% height=50%></a></h1>
            </div>
            <div class="clear"></div>
        </div>
        <div class="main mar_t18">
        <h2 class="mar_l10 mar_b8">Table Booking :</h2>
        	<form action="motion.php" method="post">
                <table width="200" border="5" cellspacing="5" cellpadding="2" class="tabletext">
                  <tr>
                    <th width="9%" scope="col">ID</th>
                    <th width="12%" scope="col">Name</th>
                    <th width="18%" scope="col">Phone</th>
                    <th width="14%" scope="col">NumOfPeople</th>
                    <th width="38%" scope="col">Date</th>
                    <th width="9%" scope="col">Edit</th>
                  </tr>
                  <tr bgcolor="#FFCC99">
                    <td>BT1</td>
                    <td>Tim</td>
                    <td>8271-6371</td>
                    <td>4</td>
                    <td>05/MAY/2013</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                  <tr>
                    <td>BT2</td>
                    <td>David</td>
                    <td>8451-2172</td>
                    <td>3</td>
                    <td>01/JUN/2014</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                </table>
            </form>
        </div>
        
        <div class="main mar_t18">
        <h2 class="mar_l10 mar_b8">Customer Orders :</h2>
        	<form action="motion.php" method="post">
                <table width="200" border="5" cellspacing="5" cellpadding="2" class="tabletext">
                  <tr>
                    <th width="9%" scope="col">ID</th>
                    <th width="14%" scope="col">User Name</th>
                    <th width="37%" scope="col">Order</th>
                    <th width="31%" scope="col">Note</th>
                    <th width="9%" scope="col">Edit</th>
                  </tr>
                  <tr bgcolor="#FFCC99">
                    <td>O1</td>
                    <td><a href="#">U34</a></td>
                    <td>112,113</td>
                    <td>Tang</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                  <tr>
                    <td>O2</td>
                    <td><a href="#">U3</a></td>
                    <td>110,112,113</td>
                    <td>Wu</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                  <tr bgcolor="#FFCC99">
                    <td>O3</td>
                    <td><a href="#">U2</a></td>
                    <td>111</td>
                    <td>100Tang</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                  <tr>
                    <td>O4</td>
                    <td><a href="#">U11</a></td>
                    <td>110,113</td>
                    <td>Shen</td>
                    <td><input type="image" src="images/icn_trash.png" title="Trash"></td>
                  </tr>
                </table>
            </form>
        </div>
        
        <div class="main mar_t18">
        <h2 class="mar_l10 mar_b8">Food Menu :</h2>
        	<form action="motion.php" method="post">
                <table width="200" border="5" cellspacing="5" cellpadding="2" class="tabletext">
                  <tr bgcolor="#FFCC99">
                    <th scope="col">Food ID</th>
                    <th scope="col">Name</th>
                  </tr>
                  <tr>
                    <td>110</td>
                    <td>JiaoZi</td>
                  </tr>
                    <tr>
                    <td>111</td>
                    <td>ShaoMai</td>
                  </tr>
                  <tr>
                    <td>112</td>
                    <td>JiPiGu</td>
                  </tr>
                  <tr>
                    <td>113</td>
                    <td>Shi</td>
                  </tr>
                </table>
                <div align="right" class="mar_t8 mar_b8">
				<input type="submit" name="logout" style="background-color:#F90" value="Logout"/>
              	</div>
            </form>
        </div>
        <div class="footer">
        	<p class="w3-link">© 2014 JCU Students | Designed by HKFL Team</p>
		</div> 
	</div>
</body>
</html>
